home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / spoc88 / cflt20 / matherr.c < prev    next >
Text File  |  1988-06-02  |  557b  |  26 lines

  1.  
  2. #include <math.h>
  3. #include <float.h>
  4.  
  5. #define INF    (1./0.)
  6. #define NAN    (0./0.)
  7.  
  8. void startfp(void)
  9. {
  10.      /* mask all exceptions but denormal */
  11.      _control87(MCW_EM-EM_DENORMAL,MCW_EM);
  12.      HUGE_VAL = +INF;
  13. }
  14.  
  15. /* this gets called by library functions
  16.    if a domain or range error occurs
  17. */
  18. int cdecl matherr(struct exception *e)
  19. {
  20. /* return nonzero to show error has been handled */
  21. /* lib functions will return something sensible, */
  22. /* if you let them */    
  23. /* we don't need no steenkeen' errors! */
  24.      return 1;
  25. }
  26.